<?php
namespace App\Http\Controllers\H5;
use App\Http\Controllers\BaseController;
use App\Http\Middleware\CustomerAuth;
use App\Params\H5\SecKillRushParams;
use App\Services\Promotion\SecKillService;
use App\Traits\VerifyRequestParam;

/**
 * 秒杀营销控制器
 *
 * @package App\Http\Controllers\H5
 * @author WangBin
 * @date 2021-10/08
 */
class SecKillController extends BaseController
{
    use VerifyRequestParam;

    public function __construct()
    {
        $this->middleware(CustomerAuth::class);
    }

    /**
     * 客户抢购
     *
     * @throws
     * @return
     */
    public function rush()
    {
        $param = SecKillRushParams::create();
        $ret = SecKillService::getInstance()->rush($param);
        return $this->success($ret);
    }
}
